﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProtocoloNameSpace;
using HTSwitchServerNamespace.Protocols;
using Newtonsoft.Json;
using HTSwitchServerNamespace.DataMocks;
using HL7v_2x;
using CLoggerNamespace;

namespace HTSwitchServerNamespace
{
    public class ProtocoloTipoMensaje
    {
      
        #region MetodosProtocolocomunicacion


        public IProtocol ObtenerProtocoloMsg(string strMSHMsg)
        {

            

            // Returns the data received from the host to the console.
            
            //EJEMPLO MENSAJE HL7
            /*
             MSH|^~\&|HIG||CPS||20050426113700||ADT^A01^ADT_A01|HIG9744495|P|2.5||||AL<cr>

            EVN|A01|20050426113700||||20050426113700|<cr>


            PID|1||163136^^^^HIG|24957389^^^^DNI|LANE^LUISA||19751128000000|F|||BLANCO ENCALADA 3422 4 C^^||||||||24957389 <cr>

            PV1|1|I|^256^|R||||||M|||A|4|A0|N||VL|H0173963||SI|||||||||||||||||||||||20050426113700 <cr>      
              
            */



            CLogger.Append("Mensaje Leido:" + strMSHMsg + " (" + strMSHMsg.Length.ToString() + " caracter(es))", CLogger.INFO);

            /*try
            {
                int inLastInSTR = strMSHMsg.LastIndexOf("EVN|");

                if (strMSHMsg.Contains("ADT ^ A01 ^ ADT_A01"))  ////////////////////////////////////////DISPOSITIVO GPS ANDROID GPLAY///////////////////
                {

                   // ADT^A01^ADT_A01

                    new HL7Segment(HL7MessageName.MessageACC);

                }
                
            }
            catch(Exception ex)
            { 
            
            }*/

            return null;
        }
        #endregion

        #region Constructor
        /// <summary>
        /// Constructor por defecto
        /// </summary>
        //public ProtocoloComunicacion()
        //{	

        //}
        #endregion
    }
}





